package com.example.websockettest.webSocket.Controller;

import com.example.websockettest.webSocket.entity.GameUser;
import com.example.websockettest.webSocket.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/register")
    public boolean register(@RequestBody GameUser user){
        return userService.register(user);
    }

    @PostMapping("/login")
    public boolean login(@RequestBody GameUser user){
        return userService.login(user);
    }
}
